package com.ef.springboot.web;


import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

@Controller
public class UserController {

    @RequestMapping(value = "/user/detail")
    public @ResponseBody Object userDetail(){

        HashMap<Object, Object> objectObjectHashMap = new HashMap<>();
        objectObjectHashMap.put("id",1001);
        objectObjectHashMap.put("username","lisi");
        return objectObjectHashMap;
    }

    @RequestMapping(value = "/user/page/detail")
    public String userDetail(Model model){
        model.addAttribute("id",1001);
        model.addAttribute("username","wangwu");
        return "userDetail";
    }



}
